home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Acao
/
BlueCustom.swf
/
scripts
/
frame_630
/
PlaceObject2_299_92
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2008-09-25
|
3KB
|
142 lines
onClipEvent(enterFrame){
if(die == 0)
{
if(this._currentframe < 10)
{
this.gotoAndPlay("die");
}
}
if(die == 1)
{
if(this._x > 3500)
{
this._x = -3000;
}
if(this._x < -3100)
{
this._x = 3400;
}
if(this._y > 2000)
{
this._y = 1900;
this._rotation += 90;
}
if(this._y < -500)
{
this._y = 1900;
this._rotation += 90;
}
this._xscale = mesize;
this._yscale = mesize;
if(this._y < 500)
{
if(this._x < 700)
{
if(this._x > 0)
{
myRadians = Math.atan2(this._y - _root.player._y,this._x - _root.player._x);
xleg = this._x - _root.player._x;
yleg = this._y - _root.player._y;
scared = Math.sqrt(xleg * xleg + yleg * yleg);
toploc = (_root.depth._y - this._y) * -1;
}
}
}
if(this._y < _root.depth._y + 100)
{
air += 0.4;
if(this._rotation > 0)
{
if(this._rotation < 90)
{
this._rotation -= 3;
}
}
if(this._rotation < 180)
{
if(this._rotation > 90)
{
this._rotation += 3;
}
}
}
else if(air > 0.5)
{
air -= 0.5;
}
if(movey == 1)
{
this._x += _global.xgo;
this._y += _global.ygo + air;
}
this._x -= Math.cos(3.141592653589793 * this._rotation / 180) * mespeed;
this._y -= Math.sin(3.141592653589793 * this._rotation / 180) * mespeed;
if(scared < 500 - mespeed * 10)
{
if(toploc < 20)
{
if(_root.player._x < this._x)
{
this._rotation += 10;
}
else
{
this._rotation -= 10;
}
}
else
{
myDegrees = Math.round(myRadians * 180 / 3.141592653589793);
if(_global.boom == 0)
{
if(this._rotation > myDegrees)
{
this._rotation -= turnspeed;
}
if(this._rotation < myDegrees)
{
this._rotation += turnspeed;
}
}
else
{
this._rotation -= 5;
}
}
}
}
else if(movey == 1)
{
this._x += _global.xgo;
this._y += _global.ygo;
}
if(_global.vincy < 0)
{
if(this.eat.hitTest(_root.player.eat))
{
_root.player.die = 0;
eat = new Sound();
eat.attachSound("eatit1");
eat.start(0,1);
_root.player.gotoAndPlay("die");
_global.xgo = 0;
_global.ygo = 0;
}
}
if(_global.vincy > 0)
{
if(this.eat.hitTest(_root.player.eat))
{
die = 0;
eat = new Sound();
eat.attachSound("eatit1");
eat.start(0,1);
this.gotoAndPlay("die");
scoreity = 299;
_root.tools.instascore.text = "+" + scoreity;
_root.tools.instblock._alpha = 0;
_global.scoreit = _global.scoreit * 1 + scoreity;
}
}
}